
#ifndef CALLBACK_H
#define CALLBACK_H

#include<osg/NodeCallback>
#include<osg/Timer>
#include<osg/Node>
#include "btnode.h"
#include "global.h"

/* Update call back. 
 * Object used/registered in function create_scenegraph. 
 * */
class CBTreeInsert : public osg::NodeCallback
{
	protected:

		DataContainer input;
		int count; /* Input data counter. */
		BinaryTreeType tree_type;
		BinaryTreeNode * btroot;
		osg::Timer_t start_tick;

	public:

		CBTreeInsert(DataContainer& input, BinaryTreeType type);
		virtual void operator()(osg::Node * node, osg::NodeVisitor * nv);
};

#endif
